//
//  MessageModel.m
//  QuickCure1
//
//  Created by summer的Dad on 16/11/1.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "MessageModel.h"

@implementation MessageModel
- (NSString *)description
{
    
    return [self yy_modelDescription];
    
    
}



//遍历数组
- (NSArray*)ZQ_arrayWithPlistName :(NSString *)plistName className :(NSString *)className
{
    // 1. 获取plist文件的地址
    NSURL *url = [[NSBundle mainBundle] URLForResource:plistName withExtension:nil];
    
    // 2. 加载Plist字典集合
    NSArray *dictArr = [NSArray arrayWithContentsOfURL:url];
    
    // 3. 遍历字典集合，创建模型对象，添加到一个可变数组红
    NSMutableArray *modelArrM = [NSMutableArray array];
    
    [dictArr enumerateObjectsUsingBlock:^(NSDictionary *dict, NSUInteger idx, BOOL * _Nonnull stop)
     {
         Class clz = NSClassFromString(className);
         
         NSObject *obj = [[clz alloc] init];
         
         [obj setValuesForKeysWithDictionary:dict];
         
         [modelArrM addObject:obj];
         
     }];
    
    return modelArrM.copy;
}
@end
